/*
 * Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * https://github.com/Bilibili/jni4android
 * This file is automatically generated by jni4android, do not modify.
 */

#include "AudioRenderer.h"

#include <stdio.h>

typedef struct J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder {
    jclass id;

    jmethodID constructor_Builder;
    jfieldID field_speed;
    jfieldID field_pitch;
    jmethodID method_build;
} J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder;
static J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder;

typedef struct J4AC_ohos_media_audio_AudioRenderer__SpeedPara {
    jclass id;

    jmethodID constructor_SpeedPara;
    jmethodID method_getSpeed;
    jmethodID method_getPitch;
} J4AC_ohos_media_audio_AudioRenderer__SpeedPara;
static J4AC_ohos_media_audio_AudioRenderer__SpeedPara class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara;

typedef struct J4AC_ohos_media_audio_AudioRenderer__ChannelVolume {
    jclass id;

    jmethodID constructor_ChannelVolume;
} J4AC_ohos_media_audio_AudioRenderer__ChannelVolume;
static J4AC_ohos_media_audio_AudioRenderer__ChannelVolume class_J4AC_ohos_media_audio_AudioRenderer__ChannelVolume;

typedef struct J4AC_ohos_media_audio_AudioRenderer {
    jclass id;

    jmethodID constructor_AudioRenderer;
    jmethodID method_getMinBufferSize;
    jmethodID method_getMaxVolume;
    jmethodID method_getMinVolume;
    jmethodID method_getSampleRate;
    jmethodID method_start;
    jmethodID method_pause;
    jmethodID method_stop;
    jmethodID method_flush;
    jmethodID method_release;
    jmethodID method_write;
    jmethodID method_setVolume;
    jmethodID method_getRendererSessionId;
    jmethodID method_getPlaybackSpeed;
    jmethodID method_setPlaybackSpeed;
} J4AC_ohos_media_audio_AudioRenderer;
static J4AC_ohos_media_audio_AudioRenderer class_J4AC_ohos_media_audio_AudioRenderer;

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__SpeedPara(JNIEnv *env, jfloat speed, jfloat pitch)
{
    return (*env)->NewObject(env, class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.id, class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.constructor_SpeedPara, speed, pitch);
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__SpeedPara__catchAll(JNIEnv *env, jfloat speed, jfloat pitch)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__SpeedPara(env, speed, pitch);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__SpeedPara__asGlobalRef__catchAll(JNIEnv *env, jfloat speed, jfloat pitch)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__SpeedPara__catchAll(env, speed, pitch);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jfloat J4AC_ohos_media_audio_AudioRenderer__SpeedPara__getSpeed(JNIEnv *env, jobject thiz)
{
    return (*env)->CallFloatMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.method_getSpeed);
}

jfloat J4AC_ohos_media_audio_AudioRenderer__SpeedPara__getSpeed__catchAll(JNIEnv *env, jobject thiz)
{
    jfloat ret_value = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__getSpeed(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return 0;
    }

    return ret_value;
}

jfloat J4AC_ohos_media_audio_AudioRenderer__SpeedPara__getPitch(JNIEnv *env, jobject thiz)
{
    return (*env)->CallFloatMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.method_getPitch);
}

jfloat J4AC_ohos_media_audio_AudioRenderer__SpeedPara__getPitch__catchAll(JNIEnv *env, jobject thiz)
{
    jfloat ret_value = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__getPitch(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return 0;
    }

    return ret_value;
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__Builder(JNIEnv *env)
{
    return (*env)->NewObject(env, class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.id, class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.constructor_Builder);
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__Builder__catchAll(JNIEnv *env)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__Builder(env);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__Builder__asGlobalRef__catchAll(JNIEnv *env)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__Builder__catchAll(env);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__speed__get(JNIEnv *env, jobject thiz)
{
    return (*env)->GetObjectField(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.field_speed);
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__speed__get__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__speed__get(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__speed__get__asGlobalRef__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__speed__get__catchAll(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

void J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__speed__set(JNIEnv *env, jobject thiz, jobject value)
{
    (*env)->SetObjectField(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.field_speed, value);
}

void J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__speed__set__catchAll(JNIEnv *env, jobject thiz, jobject value)
{
    J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__speed__set(env, thiz, value);
    J4A_ExceptionCheck__catchAll(env);
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__pitch__get(JNIEnv *env, jobject thiz)
{
    return (*env)->GetObjectField(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.field_pitch);
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__pitch__get__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__pitch__get(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__pitch__get__asGlobalRef__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__pitch__get__catchAll(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

void J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__pitch__set(JNIEnv *env, jobject thiz, jobject value)
{
    (*env)->SetObjectField(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.field_pitch, value);
}

void J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__pitch__set__catchAll(JNIEnv *env, jobject thiz, jobject value)
{
    J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__pitch__set(env, thiz, value);
    J4A_ExceptionCheck__catchAll(env);
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__build(JNIEnv *env, jobject thiz)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.method_build);
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__build__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__build(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__build__asGlobalRef__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder__build__catchAll(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

int J4A_loadClass__J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder(JNIEnv *env)
{


    int         ret                   = -1;
    const char *J4A_UNUSED(name)      = NULL;
    const char *J4A_UNUSED(sign)      = NULL;
    jclass      J4A_UNUSED(class_id)  = NULL;
    int         J4A_UNUSED(api_level) = 0;

    if (class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.id != NULL)
        return 0;



    sign = "ohos/media/audio/AudioRenderer$SpeedPara$Builder";
    class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.id = J4A_FindClass__asGlobalRef__catchAll(env, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.id == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.id;
    name     = "<init>";
    sign     = "()V";
    class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.constructor_Builder = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.constructor_Builder == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.id;
    name     = "speed";
    sign     = "Lohos/media/audio/AudioRenderer$SpeedPara$Builder;";
    class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.field_speed = J4A_GetFieldID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.field_speed == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.id;
    name     = "pitch";
    sign     = "Lohos/media/audio/AudioRenderer$SpeedPara$Builder;";
    class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.field_pitch = J4A_GetFieldID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.field_pitch == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.id;
    name     = "build";
    sign     = "()Lohos/media/audio/AudioRenderer$SpeedPara;";
    class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.method_build = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder.method_build == NULL)
        goto fail;



    J4A_ALOGD("J4ALoader: OK: '%s' loaded\n", "ohos.media.audio.AudioRenderer$SpeedPara$Builder");
    ret = 0;
fail:
    return ret;
}

int J4A_loadClass__J4AC_ohos_media_audio_AudioRenderer__SpeedPara(JNIEnv *env)
{

    int         ret                   = -1;
    const char *J4A_UNUSED(name)      = NULL;
    const char *J4A_UNUSED(sign)      = NULL;
    jclass      J4A_UNUSED(class_id)  = NULL;
    int         J4A_UNUSED(api_level) = 0;

    if (class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.id != NULL)
        return 0;

    sign = "ohos/media/audio/AudioRenderer$SpeedPara";
    class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.id = J4A_FindClass__asGlobalRef__catchAll(env, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.id == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.id;
    name     = "<init>";
    sign     = "(FF)V";
    class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.constructor_SpeedPara = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.constructor_SpeedPara == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.id;
    name     = "getSpeed";
    sign     = "()F";
    class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.method_getSpeed = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.method_getSpeed == NULL)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.id;
    name     = "getPitch";
    sign     = "()F";
    class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.method_getPitch = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer__SpeedPara.method_getPitch == NULL)
        goto fail;



    ret =0;// J4A_loadClass__J4AC_ohos_media_audio_AudioRenderer__SpeedPara__Builder(env);
    if (ret)
        goto fail;



    J4A_ALOGD("J4ALoader: OK: '%s' loaded\n", "ohos.media.audio.AudioRenderer$SpeedPara");

    ret = 0;
fail:

    return ret;
}

jobject J4AC_ohos_media_audio_AudioRenderer__ChannelVolume__ChannelVolume(JNIEnv *env, jfloat inputLeftVolume, jfloat inputRightVolume)
{
    return (*env)->NewObject(env, class_J4AC_ohos_media_audio_AudioRenderer__ChannelVolume.id, class_J4AC_ohos_media_audio_AudioRenderer__ChannelVolume.constructor_ChannelVolume, inputLeftVolume, inputRightVolume);
}

jobject J4AC_ohos_media_audio_AudioRenderer__ChannelVolume__ChannelVolume__catchAll(JNIEnv *env, jfloat inputLeftVolume, jfloat inputRightVolume)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRenderer__ChannelVolume__ChannelVolume(env, inputLeftVolume, inputRightVolume);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRenderer__ChannelVolume__ChannelVolume__asGlobalRef__catchAll(JNIEnv *env, jfloat inputLeftVolume, jfloat inputRightVolume)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRenderer__ChannelVolume__ChannelVolume__catchAll(env, inputLeftVolume, inputRightVolume);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

int J4A_loadClass__J4AC_ohos_media_audio_AudioRenderer__ChannelVolume(JNIEnv *env)
{
    int         ret                   = -1;
    const char *J4A_UNUSED(name)      = NULL;
    const char *J4A_UNUSED(sign)      = NULL;
    jclass      J4A_UNUSED(class_id)  = NULL;
    int         J4A_UNUSED(api_level) = 0;

    if (class_J4AC_ohos_media_audio_AudioRenderer__ChannelVolume.id != NULL)
        return 0;

    sign = "ohos/media/audio/AudioRenderer$ChannelVolume";
    class_J4AC_ohos_media_audio_AudioRenderer__ChannelVolume.id = J4A_FindClass__asGlobalRef__catchAll(env, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer__ChannelVolume.id == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer__ChannelVolume.id;
    name     = "<init>";
    sign     = "(FF)V";
    class_J4AC_ohos_media_audio_AudioRenderer__ChannelVolume.constructor_ChannelVolume = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer__ChannelVolume.constructor_ChannelVolume == NULL)
        goto fail;

    J4A_ALOGD("J4ALoader: OK: '%s' loaded\n", "ohos.media.audio.AudioRenderer$ChannelVolume");
    ret = 0;
fail:
    return ret;
}

jobject J4AC_ohos_media_audio_AudioRenderer__AudioRenderer(JNIEnv *env, jobject audioRendererInfo, jobject pm)
{
    return (*env)->NewObject(env, class_J4AC_ohos_media_audio_AudioRenderer.id, class_J4AC_ohos_media_audio_AudioRenderer.constructor_AudioRenderer, audioRendererInfo, pm);
}

jobject J4AC_ohos_media_audio_AudioRenderer__AudioRenderer__catchAll(JNIEnv *env, jobject audioRendererInfo, jobject pm)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRenderer__AudioRenderer(env, audioRendererInfo, pm);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRenderer__AudioRenderer__asGlobalRef__catchAll(JNIEnv *env, jobject audioRendererInfo, jobject pm)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRenderer__AudioRenderer__catchAll(env, audioRendererInfo, pm);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jint J4AC_ohos_media_audio_AudioRenderer__getMinBufferSize(JNIEnv *env, jint sampleRate, jobject format, jobject channelMask)
{
    if(format==NULL){

    }

    if(channelMask==NULL){

    }

    if(class_J4AC_ohos_media_audio_AudioRenderer.method_getMinBufferSize==NULL){

    }

    char c[50];
    sprintf(c,"getMinBufferSize %d",sampleRate);



    return (*env)->CallStaticIntMethod(env, class_J4AC_ohos_media_audio_AudioRenderer.id, class_J4AC_ohos_media_audio_AudioRenderer.method_getMinBufferSize, sampleRate, format, channelMask);
}

jint J4AC_ohos_media_audio_AudioRenderer__getMinBufferSize__catchAll(JNIEnv *env, jint sampleRate, jobject format, jobject channelMask)
{
    jint ret_value = J4AC_ohos_media_audio_AudioRenderer__getMinBufferSize(env, sampleRate, format, channelMask);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return 0;
    }

    return ret_value;
}

jfloat J4AC_ohos_media_audio_AudioRenderer__getMaxVolume(JNIEnv *env)
{
    return (*env)->CallStaticFloatMethod(env, class_J4AC_ohos_media_audio_AudioRenderer.id, class_J4AC_ohos_media_audio_AudioRenderer.method_getMaxVolume);
}

jfloat J4AC_ohos_media_audio_AudioRenderer__getMaxVolume__catchAll(JNIEnv *env)
{
    jfloat ret_value = J4AC_ohos_media_audio_AudioRenderer__getMaxVolume(env);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return 0;
    }

    return ret_value;
}

jfloat J4AC_ohos_media_audio_AudioRenderer__getMinVolume(JNIEnv *env)
{
    return (*env)->CallStaticFloatMethod(env, class_J4AC_ohos_media_audio_AudioRenderer.id, class_J4AC_ohos_media_audio_AudioRenderer.method_getMinVolume);
}

jfloat J4AC_ohos_media_audio_AudioRenderer__getMinVolume__catchAll(JNIEnv *env)
{
    jfloat ret_value = J4AC_ohos_media_audio_AudioRenderer__getMinVolume(env);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return 0;
    }

    return ret_value;
}

jint J4AC_ohos_media_audio_AudioRenderer__getSampleRate(JNIEnv *env, jobject thiz)
{
    return (*env)->CallIntMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer.method_getSampleRate);
}

jint J4AC_ohos_media_audio_AudioRenderer__getSampleRate__catchAll(JNIEnv *env, jobject thiz)
{
    jint ret_value = J4AC_ohos_media_audio_AudioRenderer__getSampleRate(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return 0;
    }

    return ret_value;
}

jboolean J4AC_ohos_media_audio_AudioRenderer__start(JNIEnv *env, jobject thiz)
{
    return (*env)->CallBooleanMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer.method_start);
}

jboolean J4AC_ohos_media_audio_AudioRenderer__start__catchAll(JNIEnv *env, jobject thiz)
{
    jboolean ret_value = J4AC_ohos_media_audio_AudioRenderer__start(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return false;
    }

    return ret_value;
}

jboolean J4AC_ohos_media_audio_AudioRenderer__pause(JNIEnv *env, jobject thiz)
{
    return (*env)->CallBooleanMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer.method_pause);
}

jboolean J4AC_ohos_media_audio_AudioRenderer__pause__catchAll(JNIEnv *env, jobject thiz)
{
    jboolean ret_value = J4AC_ohos_media_audio_AudioRenderer__pause(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return false;
    }

    return ret_value;
}

jboolean J4AC_ohos_media_audio_AudioRenderer__stop(JNIEnv *env, jobject thiz)
{
    return (*env)->CallBooleanMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer.method_stop);
}

jboolean J4AC_ohos_media_audio_AudioRenderer__stop__catchAll(JNIEnv *env, jobject thiz)
{
    jboolean ret_value = J4AC_ohos_media_audio_AudioRenderer__stop(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return false;
    }

    return ret_value;
}

jboolean J4AC_ohos_media_audio_AudioRenderer__flush(JNIEnv *env, jobject thiz)
{
    return (*env)->CallBooleanMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer.method_flush);
}

jboolean J4AC_ohos_media_audio_AudioRenderer__flush__catchAll(JNIEnv *env, jobject thiz)
{
    jboolean ret_value = J4AC_ohos_media_audio_AudioRenderer__flush(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return false;
    }

    return ret_value;
}

jboolean J4AC_ohos_media_audio_AudioRenderer__release(JNIEnv *env, jobject thiz)
{
    return (*env)->CallBooleanMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer.method_release);
}

jboolean J4AC_ohos_media_audio_AudioRenderer__release__catchAll(JNIEnv *env, jobject thiz)
{
    jboolean ret_value = J4AC_ohos_media_audio_AudioRenderer__release(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return false;
    }

    return ret_value;
}

jboolean J4AC_ohos_media_audio_AudioRenderer__write(JNIEnv *env, jobject thiz, jbyteArray data, jint offset, jint size)
{
    return (*env)->CallBooleanMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer.method_write, data, offset, size);
}

jboolean J4AC_ohos_media_audio_AudioRenderer__write__catchAll(JNIEnv *env, jobject thiz, jbyteArray data, jint offset, jint size)
{
    jboolean ret_value = J4AC_ohos_media_audio_AudioRenderer__write(env, thiz, data, offset, size);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return false;
    }

    return ret_value;
}

jboolean J4AC_ohos_media_audio_AudioRenderer__setVolume(JNIEnv *env, jobject thiz, jobject channelVolume)
{
    return (*env)->CallBooleanMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer.method_setVolume, channelVolume);
}

jboolean J4AC_ohos_media_audio_AudioRenderer__setVolume__catchAll(JNIEnv *env, jobject thiz, jobject channelVolume)
{
    jboolean ret_value = J4AC_ohos_media_audio_AudioRenderer__setVolume(env, thiz, channelVolume);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return false;
    }

    return ret_value;
}

jint J4AC_ohos_media_audio_AudioRenderer__getRendererSessionId(JNIEnv *env, jobject thiz)
{
    return (*env)->CallIntMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer.method_getRendererSessionId);
}

jint J4AC_ohos_media_audio_AudioRenderer__getRendererSessionId__catchAll(JNIEnv *env, jobject thiz)
{
    jint ret_value = J4AC_ohos_media_audio_AudioRenderer__getRendererSessionId(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return 0;
    }

    return ret_value;
}

jobject J4AC_ohos_media_audio_AudioRenderer__getPlaybackSpeed(JNIEnv *env, jobject thiz)
{
    return (*env)->CallObjectMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer.method_getPlaybackSpeed);
}

jobject J4AC_ohos_media_audio_AudioRenderer__getPlaybackSpeed__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object = J4AC_ohos_media_audio_AudioRenderer__getPlaybackSpeed(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !ret_object) {
        return NULL;
    }

    return ret_object;
}

jobject J4AC_ohos_media_audio_AudioRenderer__getPlaybackSpeed__asGlobalRef__catchAll(JNIEnv *env, jobject thiz)
{
    jobject ret_object   = NULL;
    jobject local_object = J4AC_ohos_media_audio_AudioRenderer__getPlaybackSpeed__catchAll(env, thiz);
    if (J4A_ExceptionCheck__catchAll(env) || !local_object) {
        ret_object = NULL;
        goto fail;
    }

    ret_object = J4A_NewGlobalRef__catchAll(env, local_object);
    if (!ret_object) {
        ret_object = NULL;
        goto fail;
    }

fail:
    J4A_DeleteLocalRef__p(env, &local_object);
    return ret_object;
}

jboolean J4AC_ohos_media_audio_AudioRenderer__setPlaybackSpeed(JNIEnv *env, jobject thiz, jobject speedPara)
{
    return (*env)->CallBooleanMethod(env, thiz, class_J4AC_ohos_media_audio_AudioRenderer.method_setPlaybackSpeed, speedPara);
}

jboolean J4AC_ohos_media_audio_AudioRenderer__setPlaybackSpeed__catchAll(JNIEnv *env, jobject thiz, jobject speedPara)
{
    jboolean ret_value = J4AC_ohos_media_audio_AudioRenderer__setPlaybackSpeed(env, thiz, speedPara);
    if (J4A_ExceptionCheck__catchAll(env)) {
        return false;
    }

    return ret_value;
}

int J4A_loadClass__J4AC_ohos_media_audio_AudioRenderer(JNIEnv *env)
{

    int         ret                   = -1;
    const char *J4A_UNUSED(name)      = NULL;
    const char *J4A_UNUSED(sign)      = NULL;
    jclass      J4A_UNUSED(class_id)  = NULL;
    int         J4A_UNUSED(api_level) = 0;

    if (class_J4AC_ohos_media_audio_AudioRenderer.id != NULL)
        return 0;



    sign = "ohos/media/audio/AudioRenderer";
    class_J4AC_ohos_media_audio_AudioRenderer.id = J4A_FindClass__asGlobalRef__catchAll(env, sign);



    if (class_J4AC_ohos_media_audio_AudioRenderer.id == NULL)
        goto fail;


    ret = J4A_loadClass__J4AC_ohos_media_audio_AudioRenderer__SpeedPara(env);
    if (ret)
        goto fail;



    ret = J4A_loadClass__J4AC_ohos_media_audio_AudioRenderer__ChannelVolume(env);
    if (ret)
        goto fail;



    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "<init>";
    sign     = "(Lohos/media/audio/AudioRendererInfo;Lohos/media/audio/AudioRenderer$PlayMode;)V";
    class_J4AC_ohos_media_audio_AudioRenderer.constructor_AudioRenderer = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.constructor_AudioRenderer == NULL){

        goto fail;
    }else{

    }

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "getMinBufferSize";
    sign     = "(ILohos/media/audio/AudioStreamInfo$EncodingFormat;Lohos/media/audio/AudioStreamInfo$ChannelMask;)I";
    class_J4AC_ohos_media_audio_AudioRenderer.method_getMinBufferSize = J4A_GetStaticMethodID__catchAll(env, class_id, name, sign);

    if(class_J4AC_ohos_media_audio_AudioRenderer.method_getMinBufferSize==NULL){

    }

    if (class_J4AC_ohos_media_audio_AudioRenderer.method_getMinBufferSize == NULL){

        goto fail;
    }

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "getMaxVolume";
    sign     = "()F";
    class_J4AC_ohos_media_audio_AudioRenderer.method_getMaxVolume = J4A_GetStaticMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_getMaxVolume == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "getMinVolume";
    sign     = "()F";
    class_J4AC_ohos_media_audio_AudioRenderer.method_getMinVolume = J4A_GetStaticMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_getMinVolume == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "getSampleRate";
    sign     = "()I";
    class_J4AC_ohos_media_audio_AudioRenderer.method_getSampleRate = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_getSampleRate == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "start";
    sign     = "()Z";
    class_J4AC_ohos_media_audio_AudioRenderer.method_start = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_start == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "pause";
    sign     = "()Z";
    class_J4AC_ohos_media_audio_AudioRenderer.method_pause = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_pause == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "stop";
    sign     = "()Z";
    class_J4AC_ohos_media_audio_AudioRenderer.method_stop = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_stop == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "flush";
    sign     = "()Z";
    class_J4AC_ohos_media_audio_AudioRenderer.method_flush = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_flush == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "release";
    sign     = "()Z";
    class_J4AC_ohos_media_audio_AudioRenderer.method_release = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_release == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "write";
    sign     = "([BII)Z";
    class_J4AC_ohos_media_audio_AudioRenderer.method_write = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_write == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "setVolume";
    sign     = "(Lohos/media/audio/AudioRenderer$ChannelVolume;)Z";
    class_J4AC_ohos_media_audio_AudioRenderer.method_setVolume = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_setVolume == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "getRendererSessionId";
    sign     = "()I";
    class_J4AC_ohos_media_audio_AudioRenderer.method_getRendererSessionId = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_getRendererSessionId == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "getPlaybackSpeed";
    sign     = "()Lohos/media/audio/AudioRenderer$SpeedPara;";
    class_J4AC_ohos_media_audio_AudioRenderer.method_getPlaybackSpeed = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_getPlaybackSpeed == NULL)
        goto fail;

    class_id = class_J4AC_ohos_media_audio_AudioRenderer.id;
    name     = "setPlaybackSpeed";
    sign     = "(Lohos/media/audio/AudioRenderer$SpeedPara;)Z";
    class_J4AC_ohos_media_audio_AudioRenderer.method_setPlaybackSpeed = J4A_GetMethodID__catchAll(env, class_id, name, sign);
    if (class_J4AC_ohos_media_audio_AudioRenderer.method_setPlaybackSpeed == NULL)
        goto fail;


    J4A_ALOGD("J4ALoader: OK: '%s' loaded\n", "ohos.media.audio.AudioRenderer");
    ret = 0;
fail:

    return ret;
}
